﻿ 
using SHKF.B2C.Model.Entity.Center;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text; 

namespace SHKF.B2C.BLL.Center
{
    public class IdentityBLL : BaseBll
    {

        public IdentityBLL(SqlSugarClient db) : base(db)
        {

        }

        /// <summary>
        /// 获取全局自增SN
        /// </summary>
        /// <returns></returns>
        //public long GetProductSN()
        //{
        //    ProductIDEntity product = new ProductIDEntity();
        //    product.CreateDate = DateTime.Now;

        //    long id = freeSql
        //        .Insert<ProductIDEntity>(product)
        //        .ExecuteIdentity();

        //    return id;
        //}

        /// <summary>
        /// 美团配送自增SN
        /// </summary>
        /// <returns></returns>
        public long GetMtpsOrderSN()
        {
            MtpsOrderIDEntity info = new MtpsOrderIDEntity();
            info.CreateDate = DateTime.Now;

            long id = this.db.Insertable<MtpsOrderIDEntity>(info).ExecuteReturnBigIdentity(); 
            return id;
        }
    }
}
